<form class="form-horizontal" name="type_form" ng-submit="do_upsert()" ng-hide="open_new_ip">
    <div class="modal-header">
        <a class="close" ng-click="close()">&times;</a>

        <div class="input-prepend input-append">
            <h4>配置IP</h4>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span9" style="padding:0px 10px">
            <div class="btn-toolbar server-btn-toolbar ui-toolbar">
                <button type="button" class="btn btn-mini" ng-click="do_add()">添加</button>
                <button type="button" class="btn btn-danger btn-mini" ng-click="do_delete()">删除</button>
            </div>
        </div>
        <div class="span3">
            <span>每页显示</span>
            <select class="input-mini" ng-model="page_size" ng-options="pz for pz in page_sizes" ng-change="change(page_size)">
            </select>
            <span>条</span>
        </div>
    </div>
    <div class="modal-body">
        <table class="table table-striped table-bordered table-condensed">
            <thead>
            <tr>
                <th><input type="checkbox" ng-model="selected_all" /></th>
                <th>IP</th>
                <th>已分配</th>
                <th>已使用</th>
                <th>所属网络</th>
            </tr>
            </thead>
            <tbody>
            <tr selectable="fixedip" ng-repeat="fixedip in fixedips|activeitem">
                <td><input type="checkbox" value="{{fixedip.id}}" ng-model="selected[fixedip.id]" ng-show="fixedip.allocated=='0'"/></td>
                <td>{{ fixedip.address }}</td>
                <td>{{ fixedip.allocated | allocated }}</td>
                <td>{{ fixedip.leased | allocated }}</td>
                <td>{{ fixedip.network.name }}</td>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="pagination">
        <ul>
            <li ng-hide="should_hide()" ng-class="prev_class" ng-click="prev()"><a href="javascript:void(0);">上一页</a></li>
            <li ng-repeat="i in [] | range:page_count()" ng-hide="should_hide()" ng-click="page(i)" ng-class="(i == current_page) && 'active'">
                <a href="javascript:void(0)">{{i + 1}}</a>
            </li>
            <li ng-hide="should_hide()" ng-class="next_class" ng-click="next()"><a href="javascript:void(0);">下一页</a></li>
        </ul>
    </div>
    <div class="modal-footer">
        <span style="padding-right: 230px;color: red;" ng-show="error">{{ error }}</span>
        <a data-dismiss="modal" class="btn" ng-click="close()">关闭</a>
    </div>
</form>